<template>
  <div class="">
    <ul class="list">
      <li v-for="item in $store.state.list" :key="item.id">
        <input
          type="checkbox"
          v-model="$store.state.sel"
          :value="item"
          @change="change"
        />
        <span>{{ item.title }}</span>
        <button>删除</button>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  mounted() {},
  methods: {
    change() {
      this.$store.commit("change");
    },
  },
  components: {},
};
</script>

<style lang="scss" scoped>
.list button {
  display: none;
}
.list {
  // li {
  //   &:hover {
  //     background: #ccc;
  //     button {
  //       display: inline-block !important;
  //     }
  //   }
  // }
  li:hover {
    background: #ccc;
    button {
      display: inline-block !important;
    }
  }
}
</style>
